#include "nntp.h"

class ClientNNTP : public NNTP {
	public:
		ClientNNTP();
		~ClientNNTP();
		bool connect(const char* host, int port);
		bool createNewsGroup(string& name);
		bool listNewsGroups(vector< pair<unsigned int, string> >& ans);
		bool listArticles(vector<pair<unsigned int, string> >& ans, unsigned int& newsgroup);
		bool deleteNewsGroup(unsigned int& name);
		bool deleteArticle(unsigned int& article, unsigned int& newsgroup);
		bool createArticle(string& title, string& author, string& text, unsigned int& newsgroup);
		bool showArticle(vector<string>& res, unsigned int& article, unsigned int& newsgroup);
	private:
		bool receive(string&, size_t);
		bool send(string&);
		bool parseParNum(string&);
		bool parseParString(string&);
		Connection* connection;
};
